import globals from "globals";
import pluginJs from "@eslint/js";
import pluginVue from "eslint-plugin-vue";


/** @type {import('eslint').Linter.Config[]} */
export default [
  { files: ["**/*.{js,mjs,cjs,vue}"] },
  { languageOptions: { globals: globals.browser } },
  pluginJs.configs.recommended,
  ...pluginVue.configs["flat/essential"],
  {
    // 自定义规则配置
    rules: {
      "no-unused-vars": "warn",
      "no-undef": "warn",
      '@typescript-eslint/no-unused-vars': 'off',
      indent: [
        'error',
        2,
        {
          SwitchCase: 1
        }
      ],
      'vue/multi-word-component-names': [
        'error',
        {
          ignores: ['index', 'Header', 'tag', 'Tag'] //需要忽略的组件名
        }
      ],
      '@typescript-eslint/no-var-requires': 'off',
      '@typescript-eslint/no-explicit-any': 'off',
      semi: 'off',
      '@typescript-eslint/no-this-alias': 'off',
      'eslintno-debugger': 'off',
      'vue/no-unused-vars': 'off',
      'vue/no-template-shadow': 'off',
      'vue/require-v-for-key': 'off',
      'vue/no-textarea-mustache': 'off',
      'vue/no-v-html': 'off',
      'no-constant-condition': 'off'
    }
  }
];